package com.xuecheng.learning.feign;

import com.xuecheng.commons.model.dto.RecordDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.learning.service.CourseRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class FeignCourseRecordController {


    @Autowired
    private CourseRecordService courseRecordService;


    // （支付成功了）保存或更新选课记录
    @PostMapping("/courseRecord/saveRecord")
    public ResponseResult saveRecord(@RequestBody RecordDto dto){
        // int i  = 1/0;
        return courseRecordService.saveRecord(dto);
    }
}
